package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
public class Receivingcontact {
    private int rcId;//主键
    private Integer cusId;//客户信息id
    private String consigneeName;//收货人名字
    private String rcPhone;//收货人电话
    private Integer rcState;//可用状态
    private String rcAddressProvince;//省
    private String rcAddressCity;//市
    private String rcAddressArea;//区
    private String rcAddressDetailed;//详细地址
    private Timestamp rcCreationTime;//创建时间
    private Timestamp rcUpdateTime;//跟新时间
    //private String rcAddress;
    //private OrderInfo orderInfoByOrderId;

    @Id
    @Column(name = "rc_id")
    public int getRcId() {
        return rcId;
    }

    public void setRcId(int rcId) {
        this.rcId = rcId;
    }

    @Basic
    @Column(name = "cus_id")
    public Integer getCusId() {
        return cusId;
    }

    public void setCusId(Integer cusId) {
        this.cusId = cusId;
    }

    @Basic
    @Column(name = "consignee_name")
    public String getConsigneeName() {
        return consigneeName;
    }

    public void setConsigneeName(String consigneeName) {
        this.consigneeName = consigneeName;
    }

    @Basic
    @Column(name = "rc_phone")
    public String getRcPhone() {
        return rcPhone;
    }

    public void setRcPhone(String rcPhone) {
        this.rcPhone = rcPhone;
    }

   /* @Basic
    @Column(name = "rc_address")
    public String getRcAddress() {
        return rcAddress;
    }

    public void setRcAddress(String rcAddress) {
        this.rcAddress = rcAddress;
    }*/

    @Basic
    @Column(name = "rc_state")
    public Integer getRcState() {
        return rcState;
    }

    public void setRcState(Integer rcState) {
        this.rcState = rcState;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Receivingcontact that = (Receivingcontact) o;
        return rcId == that.rcId &&
                Objects.equals(cusId, that.cusId) &&
                Objects.equals(consigneeName, that.consigneeName) &&
                Objects.equals(rcPhone, that.rcPhone) &&
                Objects.equals(rcState, that.rcState);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rcId, cusId, consigneeName, rcPhone, rcState);
    }

    @Basic
    @Column(name = "rc_address_province")
    public String getRcAddressProvince() {
        return rcAddressProvince;
    }

    public void setRcAddressProvince(String rcAddressProvince) {
        this.rcAddressProvince = rcAddressProvince;
    }

    @Basic
    @Column(name = "rc_address_city")
    public String getRcAddressCity() {
        return rcAddressCity;
    }

    public void setRcAddressCity(String rcAddressCity) {
        this.rcAddressCity = rcAddressCity;
    }

    @Basic
    @Column(name = "rc_address_area")
    public String getRcAddressArea() {
        return rcAddressArea;
    }

    public void setRcAddressArea(String rcAddressArea) {
        this.rcAddressArea = rcAddressArea;
    }

    @Basic
    @Column(name = "rc_address_detailed")
    public String getRcAddressDetailed() {
        return rcAddressDetailed;
    }

    public void setRcAddressDetailed(String rcAddressDetailed) {
        this.rcAddressDetailed = rcAddressDetailed;
    }

    @Basic
    @Column(name = "rc_creation_time")
    public Timestamp getRcCreationTime() {
        return rcCreationTime;
    }

    public void setRcCreationTime(Timestamp rcCreationTime) {
        this.rcCreationTime = rcCreationTime;
    }

    @Basic
    @Column(name = "rc_update_time")
    public Timestamp getRcUpdateTime() {
        return rcUpdateTime;
    }

    public void setRcUpdateTime(Timestamp rcUpdateTime) {
        this.rcUpdateTime = rcUpdateTime;
    }

    /*@ManyToOne
    @JoinColumn(name = "order_id", referencedColumnName = "order_id")
    public OrderInfo getOrderInfoByOrderId() {
        return orderInfoByOrderId;
    }

    public void setOrderInfoByOrderId(OrderInfo orderInfoByOrderId) {
        this.orderInfoByOrderId = orderInfoByOrderId;
    }*/
}
